<?php
namespace app\web\controller;


class Zidingyiadd extends Base
{
    public function Zidingyiadd()
    {
 // 	public function dowebzidingyiadd(){
	// 	global $_G, $_P;
	// 	//load_func('tpl');

	// 	$system=$_G['system'];


	// 	$system['qiye']='8';
	// 	$myshop = db_find ( "SELECT * FROM " . tablename ($this->shangjiatable) .
	// 			" WHERE  uniacid = '{$_G['mpid']}' and id = '{$system['qiye']}' and state = 1 order by displayorder" );
	// 	$shoplist = db_select ( "SELECT * FROM " . tablename ($this->shangjiatable) .
	// 			" WHERE  uniacid = '{$_G['mpid']}' and state = 1 order by displayorder" );
	// 	$workerlist = db_select ( "SELECT * FROM " . tablename ($this->fanstable) .
	// 			" WHERE  uniacid = '{$_G['mpid']}' and status = 2 and shopyuangong = '{$system['qiye']}' " );
	// 	$xuanze = rand(0,count($workerlist)-1);


	// 	if (checksubmit ()) {

	// 	$xunisql = "SELECT nickname,avatar FROM " . tablename('2019xuni_fans') . " where
	// 		 id =". rand(1,699) ;
	// 	$xuni = db_find ( $xunisql);
	// 	$nickname = $xuni['nickname'];

	// 	$xunisql = "SELECT nickname,avatar FROM " . tablename('2019xuni_fans') . " where
	// 		 id =". rand(1,699) ;
	// 	$xuni = db_find ( $xunisql);
	// 	$headimgurl = $xuni['avatar'];

	// 	$yuangong = intval ( $_P['yuangong'] );
	// 	$shoptitle = intval ( $_P['shoptitle'] );
	// 	$name =  $_P['name'] ;
	// 	$mobile = intval ( $_P['mobile'] );

	// 	$openid="xuni".date("YmdHis").rand(1,699);
	// 	$data = array (
	// 		'uniacid'  => $_G['mpid'],
	// 		'openid'   => $openid,
	// 		'nickname' => $nickname,
	// 		'headimgurl' => $headimgurl,
	// 		'fname' => $name,
	// 		'shopid'=>$system['qiye'],
	// 		'fmobile' => $mobile,
	// 		'sex' => 3,
	// 		'workerid' => $yuangong,
	// 		'addtime'  => date("Y-m-d H:i:s")
	// 	);
	// 	db_insert ($this->fanstable, $data );

	// 	$xunisql = "SELECT * FROM " . tablename ($this->fanstable) . " where
	// 		 openid ='". $openid ."'" ;
	// 	$fans = db_find ( $xunisql);

	// 	$data = array(
	// 			'uniacid'=>$_G['mpid'],
	// 			'uid'=> $info['uid'],
	// 			'orderno'=>'xuni',
	// 			'themeid' =>1,
	// 			'shopid'  =>$shoptitle ,
	// 			'groupid' =>0,
	// 			'detailid' =>0,
	// 			'workerid' =>$yuangong,
	// 			'shoptitle'=>$system['qiye'],
	// 			'typeid' =>rand(0,1),
	// 			'fee' => 29.9,
	// 			'fansid'=>$fans['id'],
	// 			'openid'=>$fans['openid'],
	// 			'nickname'=>$fans['nickname'],
	// 			'headimgurl'=>$fans['headimgurl'],
	// 			'addtime'=>date("Y-m-d H:i:s"),
	// 			'paytime'=>date("Y-m-d H:i:s"),				
	// 			'paystate'=>1,
	// 	);
	// 	db_insert ($this->ordertable, $data );

	// 	 	message ( '添加成功！', referer (), 'success' );

	// 	}
	// 	$return_clicent = get_defined_vars();
return view('/zidingyiadd', $return_clicent);	
	// }
}
}